Apache ActiveMQ ™ -- Getting Started 3.x
Site > Old Links > Previous Versions > Getting Started 3.x
Introduction
This document describes how to install and configure ActiveMQ 3.x for both Unix and Windows' platforms.
Document Organization
The Getting Started Guide for ActiveMQ 3.x document contains the following sections:
- Introduction
- Document Organization
- Pre-Installation Requirements
- Installation Procedure for Windows
- Installation Procedure for Unix
- Starting ActiveMQ
- Testing the Installation
- Stopping ActiveMQ
- Configuring ActiveMQ
Pre-Installation Requirements
Hardware:
- 33 MB of free disk space for the ActiveMQ 3.x binary distribution.
- 18 MB of free disk space for the ActiveMQ 3.x source or developer's distributions.
Operating Systems:
- Windows: Windows XP SP2, Windows 2000.
- Unix: Ubuntu Linux, Powerdog Linux, MacOS, AIX, HP-UX, Solaris, or any Unix platform that supports Java.
Environment:
- Java Developer Kit (JDK) 1.4.x or greater for deployment and 1.5.x (Java 5) for compiling/building.
- The JAVA_HOME environment variable must be set to the directory where the JDK is installed, e.g., c:\Program Files\jsdk.1.4.2-09.
- Maven 1.0.2 or greater (required when installing source or developer's releases).
- JARs that will be used must be added to the classpath.
Installation Procedure for Windows
This section of the Getting Started Guide explains how to install binary and source distributions of ActiveMQ on a Windows system.
Windows Binary Installation
This procedure explains how to download and install the binary distribution on a Windows system.
- From a browser, navigate to www.ActiveMQ.org.
- Click the Download link in the navigation pane (the left pane).
- Click the ActiveMQ 3.x Release link under the "Latest Releases" section. This brings up a new page.
- Under the Download Here section, select the desired distribution (you may have to scroll down to see the "Download Here" section).
For a binary distribution, the filename will be similar to: activemq-x.x.x.zip. - Extract the files from the ZIP file into a directory of your choice.
- Proceed to the Starting ActiveMQ section of this document.
- Following start-up, go to the Testing the Installation section of this document.
Windows Source Installation
This procedure explains how to download and install the source distribution on a Windows system.
NOTE: ActiveMQ can be run on a Java 1.4.x system, however, Java 1.5 is required to compile/build ActiveMQ.
- From a browser, navigate to www.ActiveMQ.org.
- Click the Download link in the navigation pane (the left pane).
- Click the ActiveMQ 3.x Release link under the "Latest Releases" section. This brings up another page.
- Under the Download Here section, select the desired distribution (if necessary, scroll down to see the "Download Here" section).
For a source distribution, the filename will be similar to: activemq-x.x-src.zip. - Extract ActiveMQ from the ZIP file into a directory of your choice.
Build ActiveMQ using Maven 1.0.2 or greater and Java 1.5.
<![CDATA[ The recommended method of building ActiveMQ is the following: cd [activemq_install_dir] where [activemq_install_dir] is the directory in which ActiveMQ was installed. maven clean test If the above build fails on some tests, type the following: cd [activemq_install_dir] maven -Dmaven.test.skip=true ]]>
If you prefer to use an IDE, then you can auto-generate the IDE's project file using maven plugins:
<![CDATA[ maven eclipse or maven idea ]]>
Feel free to use any other applicable IDE. Please refer to the plugin reference for more details.
Start ActiveMQ from the target directory, for example:
<![CDATA[ cd [activemq_install_dir]\activemq-assembly\target\activemq-x.x-SNAPSHOT\ bin\activemq ]]>
NOTE: Working directories get created relative to the current directory. To create the working directories in the proper place, ActiveMQ must be launched from its home/installation directory.
Proceed to the Testing the Installation section.
NOTE: Working directories get created relative to the current directory. To create the working directories in the proper place, ActiveMQ must be launched from its home/installation directory.
Warning
If you are building ActiveMQ 3.x under Windows using Cygwin there is a path name length limitation. If the path name length is exceeded, you may see build errors. To correct this, move the ActiveMQ source directory higher in the file system tree, e.g., /cygdrive/c/d/sm.
Windows Developer's Release
This procedure explains how to download and install the latest developer's snapshot.
NOTE: ActiveMQ can be run on a Java 1.4.x system, however, Java 1.5 is required to compile/build ActiveMQ.
- From a browser, navigate to www.ActiveMQ.org.
- Click the Download link in the navigation pane (the left pane).
- Click the Current development SNAPSHOT release link.
- Select the version of ActiveMQ to download (if necessary, scroll down to see the ActiveMQ snapshots).
- Extract the files from the ZIP file into a directory of your choice.
- If a binary snapshot was downloaded, proceed to the Starting ActiveMQ section of this document.
If a source snapshot was downloaded, perform step 6 and step 7 of the Windows Source Installation procedure. - Following start-up, proceed to the Testing the Installation section.
Installation Procedure for Unix
Unix Binary Installation
This procedure explains how to download and install the binary distribution on a Unix system.
Download the activemq gzip file to the Unix machine, using either a browser or a tool, i.e., wget, scp, ftp, etc.
<![CDATA[ If the Unix machine has a browser: a. Navigate to www.ActiveMQ.org. b. Click the "Download" link in the navigation pane (the left pane). c. Click the "ActiveMQ 3.x Release" link under the "Latest Releases" section. This brings up a new page. d. Under the "Download Here" section, select the desired distribution (if necessary, scroll down to see the "Download Here" section). For a binary Unix distribution, the filename will be similar to: activemq-x.x.x.tar.gz. OR If the Unix machine does NOT have a browser, tools such as wget, scp, or ftp can be used to download the ActiveMQ distribution. It is beyond the scope of this document to explain the use of those tools. For convenience an example is provided below using a Windows machine (that has a browser) and a Unix machine with "wget" installed on it. *NOTE:* There are several alternative ways to perform this type of installation. a. Obtain the link to the ActiveMQ distribution file. On the Windows machine with a browser, navigate to www.ActiveMQ.org. b. Click the "Download" link in the left navigation pane. c. Click the "ActiveMQ 3.x Release" link under the "Latest Releases" section. This brings up a new page. d. Under the "Download Here" section, roll-over the desired distribution (if necessary, scroll down to see the "Download Here" section). For a binary Unix distribution the filename will be similar to: activemq-x.x.x.tar.gz. e. Right-click on the distribution name and Copy Shortcut f. On the Unix machine, change to the directory in which ActiveMQ will be installed, e.g., /usr/local. f. Download the ActiveMQ distribution to the Unix machine using the "wget" tool. For example, type "wget" followed by the saved shortcut: wget http://cvs.apache.org/repository/incubator-activemq/distributions/activemq-x.x.x.tar.gz ]]>
Extract the files from the gzip file into a directory of your choice. For example:
<![CDATA[ tar zxvf activemq-x.x.x.tar.gz ]]>
If the ActiveMQ start-up script is not executable, change its permisssions. The ActiveMQ script is located in the bin directory. For example:
<![CDATA[ cd [activemq_install_dir]/bin where [activemq_install_dir] is the directory in which ActiveMQ was installed. chmod 755 activemq ]]>
Proceed to the Starting ActiveMQ section of this document.
- Following start-up, go to the Testing the Installation section.
Unix Source Installation
This procedure explains how to download and install the source distribution on a Unix system. This procedure assumes the Unix machine has a browser. Please see the previous Unix Binary Installation section for details on how to install ActiveMQ without a browser.
NOTE: ActiveMQ can be run on a Java 1.4.x system, however, Java 1.5 is required to compile/build ActiveMQ.
- From a browser, navigate to www.ActiveMQ.org.
- Click the Download link in the navigation pane (the left pane).
- Click the ActiveMQ 3.x Release link under the "Latest Releases" section. This brings up a new page.
- Under the Download Here section, select the desired distribution (if necessary, scroll down to see the "Download Here" section).
For a source distribution, the filename will be similar to: activemq-x.x-src.tar.gz. Extract the files from the ZIP file into a directory of your choice. For example:
<![CDATA[ tar zxvf activemq.x.x-src.tar.gz ]]>
Build ActiveMQ using Maven 1.0.2 or greater and Java 5:
<![CDATA[ The preferred method of building ActiveMQ is the following: cd [activemq_install_dir] where [activemq_install_dir] is the directory in which ActiveMQ was installed. maven clean test If the above build fails on some tests, do the following: cd [activemq_install_dir] maven m:clean maven -Dmaven.test.skip=true ]]>
If you prefer to use an IDE then you can auto-generate the IDE's project file using maven plugins:
<![CDATA[ maven eclipse or maven idea ]]>
Feel free to use any other applicable IDE. Please refer to the plugin reference for more details.
NOTE: Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.Proceed to the Starting ActiveMQ section of this document.
- Proceed to Testing the Installation section.
Unix Developer's Release
This procedure explains how to download and install the latest developer's snapshot.
NOTE: ActiveMQ can be run on a Java 1.4.x system, however, Java 5 is required to compile/build ActiveMQ.
- From a browser, navigate to www.ActiveMQ.org.
- Click the Download link in the navigation pane (the left pane).
- Click the Current development SNAPSHOT release link.
- Select the version of ActiveMQ to download (you may have to scroll down to see the ActiveMQ snapshots). The filename will be similar to: activemq-x.x.x-tar.gz or activemq-x.x.x-src.tar.gz.
Extract the files from the gzip file into a directory of your choice. For example:
<![CDATA[ For a binary developer's snapshot: tar zxvf activemq-x.x.x.tar.gz For a source developer's snapshot: tar zxvf activemq-x.x.x-src.tar.gz ]]>
If a binary snapshot was downloaded, to make it executable, the ActiveMQ script may need its permissions changed:
<![CDATA[ cd [activemq_install_dir]/bin where [activemq_install_dir] is the directory in which ActiveMQ was installed. chmod 755 activemq ]]>
For a binary snapshot, proceed to the Starting ActiveMQ section of this document.
If a source snapshot was downloaded perform steps 6 - 8 of the Unix Source Installation procedure.
Proceed to the Testing the Installation section.
Starting ActiveMQ
On Windows:
From a console window, change to the installation directory and run ActiveMQ:
<![CDATA[ cd [activemq_install_dir] ]]>
where activemq_install_dir is the directory in which ActiveMQ was installed, e.g., c:\Program Files\ActiveMQ-3.x.
Then type:
<![CDATA[ bin\activemq ]]>
NOTE: Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.
On Unix:
From a command shell, change to the installation directory and run ActiveMQ:
<![CDATA[ cd [activemq_install_dir] ]]>
where activemq_install_dir is the directory in which ActiveMQ was installed, e.g., /usr/local/activemq-3.x.
Then type:
<![CDATA[ bin/activemq OR bin/activemq > /tmp/smlog 2>&1 &; Note: /tmp/smlog may be changed to another file name. ]]>
NOTE: Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.
Warning
Do NOT close the console or shell in which ActiveMQ was started, as that will terminate ActiveMQ (unless ActiveMQ was started with nohup).
<![CDATA[ nohup bin/activemq > /tmp/smlog 2>&1 & ]]>
Testing the Installation
If ActiveMQ is up and running without problems, the Window's console window or the Unix command shell will display information similar to the following log line:
<![CDATA[ INFO ActiveMQ JMS Message Broker (ID:apple-s-Computer.local-51222-1140729837569-0:0) has started ]]>
ActiveMQ's default port is 61616. From another window run netstat and search for port 61616.
From a Windows console, type:
<![CDATA[ netstat -an|find "61616" ]]>
OR
From a Unix command shell, type:
<![CDATA[ netstat -an|grep 61616 ]]>
Stopping ActiveMQ
For both Windows and Unix installations, terminate ActiveMQ by typing "CTRL-C" in the console or command shell in which it is running.
If ActiveMQ was started in the background on Unix, the process can be killed, with the following:
<![CDATA[ ps -ef|grep activemq kill [PID] where [PID] is the process id of the ActiveMQ process. ]]>
Configuring ActiveMQ
The ActiveMQ broker should now run. You can configure the broker by specifying an Xml Configuration file as a parameter to the activemq command.
See the Initial Configuration for details of which jars you need to add to your classpath to start using ActiveMQ in your Java code
If you want to use JNDI to connect to your JMS provider then please view the JNDI Support. If you are a Spring user you should read about Spring Support
After the installation, ActiveMQ is running with a basic configuration. For details on configuring options, please see refer to the Configuration section.
Additional Resources
If you are new to using ActiveMQ, running the Examples is a good next step to learn more about ActiveMQ.
Overview
Search
Sub Projects
Community
- Support
- Contributing
- Discussion Forums
- Mailing Lists
- IRC
- IRC Log
- Site
- Sponsorship
- Projects Using ActiveMQ
- Users
- Team
- Thanks
Features
- Advisory Message
- Clustering
- Cross Language Clients
- Enterprise Integration Patterns
- JMX
- JMS to JMS Bridge
- MasterSlave
- Message Groups
- Networks of Brokers
- Performance
- Persistence
- Security
- Virtual Destinations
- Visualisation
- More ...
Connectivity
- Ajax
- AMQP
- Axis and CXF Support
- C Integration
- C++
- C# and .Net Integration
- CMS
- J2EE
- JBoss Integration
- Jetty
- JNDI Support
- NMS
- REST
- RSS and Atom
- Spring Support
- Stomp
- Tomcat
- Unix Service
- WebLogic Integration
- XMPP
- More ...
Using ActiveMQ 5
- Getting Started
- Initial Configuration
- Running a Broker
- Embedded Brokers
- Command Line Tools
- Configuring Transports
- Examples
- Web Samples
- Monitoring the Broker
- Xml Configuration
- Xml Reference
- More ...
Using ActiveMQ 4
- Getting Started
- Initial Configuration
- Running a Broker
- Embedded Brokers
- Command Line Tools
- Configuring Transports
- Examples
- Web Samples
- Monitoring the Broker
- Xml Configuration
- Xml Reference
- More ...
Tools
External Tools
Support
Related Projects
Developers
Tests
- Maven2 Performance Plugin
- Benchmark Tests
- JMeter System Tests
- JMeter Performance Tests
- Integration Tests